﻿<%@ Page Title="Manage Work Orders" Language="C#" MasterPageFile="~/MasterPage.master"
    AutoEventWireup="true" CodeFile="Mng_WO.aspx.cs" Inherits="admin_Mng_WO" %>

<asp:Content ID="Head" ContentPlaceHolderID="head" runat="Server">
    <link href="../styles/admin.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
     <div id="top_menu">
        <div id="help_button">
            help
        </div>
                                <div id="logout">
            <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="../Default.aspx"
                OnLoggingOut="LoginStatus1_LoggingOut" />
        </div>
    </div>
    <div id="page_title">
        ADMINISTRATION
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div id="left_content">
        <div class="menu">
            <ul>
                <li><a href="Home.aspx">Home</a></li>
                <li><a href="Mng_Client.aspx">Manage Clients</a></li>
                <li><a href="Mng_Site.aspx">Manage Sites</a></li>
                <li><a href="Mng_Machine.aspx">Manage Machines</a></li>
                <li><a href="Mng_Comp.aspx">Manage Components</a></li>
                <li><a href="Mng_Report.aspx">Manage Report</a></li>
                <li><a href="#" class="current">Manage Work Order</a></li>
                <li><a href="Mng_FaultsRecom.aspx">Manage Faults Recommendation</a></li>
            </ul>
        </div>
    </div>
    <!-- end of left content -->
    <div id="right_content">
        <div class="content_area">
            <h2>
                Manage Work Orders
            </h2>
            <div class="form_box1">
                <div class="Li_buttonC1">
                    <a href="Search_Workorder.aspx" target="_self">Search Work Order</a>
                </div>
                <asp:GridView ID="GridViewWorkOrders" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    DataKeyNames="workorder_id" DataSourceID="WorkOrdersOnMachinesObjectDataSource"
                    OnSelectedIndexChanged="GridViewWorkOrders_SelectedIndexChanged" AllowSorting="True"
                    PageSize="20">
                    <Columns>
                        <asp:TemplateField HeaderText="machine_id" ShowHeader="False" SortExpression="machine_id"
                            Visible="False">
                            <EditItemTemplate>
                                <asp:TextBox ID="machine_idTextBox" runat="server" Text='<%# Bind("machine_id") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="machine_idLabel" runat="server" Text='<%# Bind("machine_id") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="date_submitted" HeaderText="Date Submitted" SortExpression="date_submitted"
                            DataFormatString="{0:d}">
                            <ItemStyle CssClass="column" />
                        </asp:BoundField>
                        <asp:BoundField DataField="workorder_reference_no" HeaderText="WO Ref. No." SortExpression="workorder_reference_no">
                            <ItemStyle CssClass="column" />
                        </asp:BoundField>
                        <asp:BoundField DataField="machineName" HeaderText="Machine" SortExpression="machineName">
                            <ItemStyle CssClass="column" />
                        </asp:BoundField>
                        <asp:CommandField SelectText="Details..." ShowSelectButton="True">
                            <ItemStyle CssClass="column" />
                        </asp:CommandField>
                    </Columns>
                    <PagerStyle CssClass="pager" />
                    <EmptyDataTemplate>
                        There is no work order placed for this machine.
                    </EmptyDataTemplate>
                    <HeaderStyle CssClass="header" />
                </asp:GridView>
                <asp:ObjectDataSource ID="WorkOrdersOnMachinesObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="DataAccess.i2iPortalTableAdapters.WorkOrdersOnMachinesTableAdapter">
                </asp:ObjectDataSource>
            </div>
        </div>
    </div>
    <!-- end of right content -->
</asp:Content>
